//
//  YD_purchaseCharmsCellB.m
//  SpeedDating
//
//  Created by isu on 16/12/15.
//  Copyright © 2016年 isu. All rights reserved.
//

#import "YD_purchaseCharmsCellB.h"

@implementation YD_purchaseCharmsCellB

- (void)awakeFromNib {
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}
+(instancetype)cellWithTableView:(UITableView*)tableView {
    static NSString *ID = @"YD_purchaseCharmsCellBCell";
    YD_purchaseCharmsCellB *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if(cell==nil){
        cell = [[YD_purchaseCharmsCellB  alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ID];
        cell.backgroundColor =[UIColor whiteColor];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return cell;
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
        
        UIImageView *imageV = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"xihuan"]];
        [self.contentView addSubview:imageV];
        [imageV mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(15);
            make.centerY.mas_equalTo(self.contentView);
            make.size.mas_equalTo(CGSizeMake(40, 40));
        }];
        
        self.showLab =[UILabel new];
        [self.contentView addSubview:self.showLab];
        [self.showLab mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(self.contentView);
            make.left.mas_equalTo(imageV.mas_right).offset(5);
        }];
        
        self.btn= [UIButton new];
        [self.contentView addSubview:self.btn];
        [self.btn mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(-20);
            make.top.mas_equalTo(imageV).offset(5);
            make.bottom.mas_equalTo(imageV).offset(-5);
            make.width.mas_equalTo(imageV.mas_width).multipliedBy(2.3);
           
        }];
        self.btn.layer.cornerRadius = 5.0f;
        self.btn.layer.masksToBounds = YES;
        self.btn.layer.borderWidth = 0.5f;
        self.btn.layer.borderColor = [[UIColor grayColor]CGColor];
        
        [self.btn setTitleColor:[UIColor colorWithRed:184/255.0 green:241/255.0 blue:125/255.0 alpha:1.0f] forState:UIControlStateNormal];
        
    }
    return self;
}
@end
